<template>
	<view>
		<u-tabs :list="menu" lineColor="#FF7E11" :current="current" :scrollable="false" activeStyle="color:#FF7E11"
			@change="setAct"></u-tabs>
		<view class="list mt30">
			<u-cell v-for="(item,index) in list" :key="index" title="我的义工招募信息" isLink size="large"
				:url="`/pages/order/recruitDetail?id=${item.id}`"></u-cell>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menu: [{
						name: "审核中",
						id: 0,
					},
					{
						name: "已审核",
						id: 1,
					},
					{
						name: "已取消",
						id: 2,
					}
				],
				current: 0,
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			setAct(e) {
				this.current = e.index;
				this.getList()
			},
			async getList() {
				const res = await this.$request({
					url: this.$api.recruitList,
					data: {
						current: this.current
					}
				})
				if (res.code == 1) {
					this.list = res.data
					console.log(this.list);
				}
			}
		}
	}
</script>

<style scoped lang="scss">

</style>